<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>数据统计 - Chart.js风格</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f8f8f8;
            padding: 20px;
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
        }
        
        .stats-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-bottom: 30px;
        }
        
        .stat-card {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            border-radius: 15px;
            padding: 25px;
            color: white;
            text-align: center;
            position: relative;
            overflow: hidden;
            box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
        }
        
        .stat-card::before {
            content: '';
            position: absolute;
            top: -50%;
            right: -50%;
            width: 100%;
            height: 100%;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
        }
        
        .stat-number {
            font-size: 36px;
            font-weight: bold;
            margin-bottom: 8px;
        }
        
        .stat-label {
            font-size: 14px;
            opacity: 0.9;
        }
        
        .stat-icon {
            position: absolute;
            top: 15px;
            right: 15px;
            font-size: 24px;
            opacity: 0.7;
        }
        
        .chart-section {
            background: white;
            border-radius: 15px;
            padding: 25px;
            margin-bottom: 25px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }
        
        .section-title {
            font-size: 20px;
            font-weight: bold;
            color: #333;
            margin-bottom: 20px;
        }
        
        .section-subtitle {
            font-size: 14px;
            color: #999;
            margin-bottom: 20px;
        }
        
        .chart-container {
            position: relative;
            height: 300px;
            margin-bottom: 20px;
        }
        
        .achievements-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        
        .achievement-item {
            background: #f8f8f8;
            border-radius: 12px;
            padding: 20px;
            text-align: center;
            transition: all 0.3s ease;
            border: 2px solid transparent;
        }
        
        .achievement-item.unlocked {
            background: linear-gradient(135deg, #fff5f5, #ffe6f0);
            border-color: #ff6b9d;
            box-shadow: 0 4px 15px rgba(255, 107, 157, 0.2);
        }
        
        .achievement-item.locked {
            opacity: 0.6;
        }
        
        .achievement-icon {
            font-size: 36px;
            margin-bottom: 12px;
        }
        
        .achievement-name {
            font-size: 16px;
            font-weight: bold;
            color: #333;
            margin-bottom: 8px;
        }
        
        .achievement-desc {
            font-size: 12px;
            color: #666;
            margin-bottom: 12px;
        }
        
        .progress-bar {
            width: 100%;
            height: 6px;
            background: #f0f0f0;
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 8px;
        }
        
        .progress-fill {
            height: 100%;
            background: linear-gradient(135deg, #ff6b9d, #c44569);
            transition: width 0.3s ease;
        }
        
        .progress-text {
            font-size: 12px;
            color: #999;
        }
        
        .trend-cards {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }
        
        .trend-card {
            background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
            border-radius: 12px;
            padding: 20px;
            color: white;
            position: relative;
            overflow: hidden;
        }
        
        .trend-card::before {
            content: '';
            position: absolute;
            top: 0;
            right: 0;
            width: 60px;
            height: 60px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 50%;
            transform: translate(20px, -20px);
        }
        
        .trend-title {
            font-size: 14px;
            opacity: 0.9;
            margin-bottom: 8px;
        }
        
        .trend-value {
            font-size: 24px;
            font-weight: bold;
            margin-bottom: 8px;
        }
        
        .trend-desc {
            font-size: 12px;
            opacity: 0.8;
        }
        
        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .chart-section, .stats-cards > * {
            animation: fadeInUp 0.6s ease-out;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 style="text-align: center; margin-bottom: 30px; color: #333;">📊 数据统计中心</h1>
        
        <!-- 统计卡片 -->
        <div class="stats-cards">
            <div class="stat-card">
                <div class="stat-number">156</div>
                <div class="stat-label">总操作次数</div>
                <div class="stat-icon">🎯</div>
            </div>
            <div class="stat-card">
                <div class="stat-number">156</div>
                <div class="stat-label">消耗算力</div>
                <div class="stat-icon">⚡</div>
            </div>
            <div class="stat-card">
                <div class="stat-number">23</div>
                <div class="stat-label">收藏商品</div>
                <div class="stat-icon">❤️</div>
            </div>
        </div>

        <!-- 使用趋势图表 -->
        <div class="chart-section">
            <div class="section-title">📈 使用趋势分析</div>
            <div class="section-subtitle">最近7天的操作记录</div>
            <div class="chart-container">
                <canvas id="usageChart"></canvas>
            </div>
        </div>

        <!-- 功能分布图表 -->
        <div class="chart-section">
            <div class="section-title">🎨 功能使用分布</div>
            <div class="section-subtitle">各功能使用次数占比</div>
            <div class="chart-container">
                <canvas id="distributionChart"></canvas>
            </div>
        </div>

        <!-- 成就系统 -->
        <div class="chart-section">
            <div class="section-title">🏆 成就徽章</div>
            <div class="section-subtitle">解锁你的专属成就</div>
            <div class="achievements-grid">
                <div class="achievement-item unlocked">
                    <div class="achievement-icon">🎯</div>
                    <div class="achievement-name">换装新手</div>
                    <div class="achievement-desc">完成首次虚拟换装</div>
                    <div class="progress-bar">
                        <div class="progress-fill" style="width: 100%;"></div>
                    </div>
                    <div class="progress-text">已解锁</div>
                </div>
                
                <div class="achievement-item unlocked">
                    <div class="achievement-icon">👗</div>
                    <div class="achievement-name">时尚达人</div>
                    <div class="achievement-desc">完成50次换装操作</div>
                    <div class="progress-bar">
                        <div class="progress-fill" style="width: 100%;"></div>
                    </div>
                    <div class="progress-text">已解锁</div>
                </div>
                
                <div class="achievement-item locked">
                    <div class="achievement-icon">👤</div>
                    <div class="achievement-name">换脸专家</div>
                    <div class="achievement-desc">完成20次换脸操作</div>
                    <div class="progress-bar">
                        <div class="progress-fill" style="width: 75%;"></div>
                    </div>
                    <div class="progress-text">15/20</div>
                </div>
                
                <div class="achievement-item locked">
                    <div class="achievement-icon">❤️</div>
                    <div class="achievement-name">收藏家</div>
                    <div class="achievement-desc">收藏30件商品</div>
                    <div class="progress-bar">
                        <div class="progress-fill" style="width: 60%;"></div>
                    </div>
                    <div class="progress-text">18/30</div>
                </div>
            </div>
        </div>

        <!-- 趋势分析 -->
        <div class="chart-section">
            <div class="section-title">📊 使用习惯分析</div>
            <div class="section-subtitle">你的个性化数据洞察</div>
            <div class="trend-cards">
                <div class="trend-card">
                    <div class="trend-title">最活跃时段</div>
                    <div class="trend-value">14:00-16:00</div>
                    <div class="trend-desc">在这个时间段你最喜欢换装</div>
                </div>
                
                <div class="trend-card">
                    <div class="trend-title">偏好风格</div>
                    <div class="trend-value">休闲风格</div>
                    <div class="trend-desc">你最常尝试的服装风格</div>
                </div>
                
                <div class="trend-card">
                    <div class="trend-title">使用频率</div>
                    <div class="trend-value">3.2次/天</div>
                    <div class="trend-desc">平均每天的使用次数</div>
                </div>
            </div>
        </div>
    </div>

    <script>
        // 使用趋势图表 (Chart.js)
        const usageCtx = document.getElementById('usageChart').getContext('2d');
        new Chart(usageCtx, {
            type: 'line',
            data: {
                labels: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'],
                datasets: [{
                    label: '使用次数',
                    data: [12, 19, 15, 25, 22, 18, 28],
                    borderColor: '#ff6b9d',
                    backgroundColor: 'rgba(255, 107, 157, 0.1)',
                    borderWidth: 3,
                    fill: true,
                    tension: 0.4,
                    pointBackgroundColor: '#ff6b9d',
                    pointBorderColor: '#fff',
                    pointBorderWidth: 2,
                    pointRadius: 6
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                plugins: {
                    legend: {
                        display: false
                    }
                },
                scales: {
                    y: {
                        beginAtZero: true,
                        grid: {
                            color: 'rgba(0, 0, 0, 0.1)'
                        }
                    },
                    x: {
                        grid: {
                            display: false
                        }
                    }
                }
            }
        });

        // 功能分布图表 (Chart.js)
        const distributionCtx = document.getElementById('distributionChart').getContext('2d');
        new Chart(distributionCtx, {
            type: 'doughnut',
            data: {
                labels: ['虚拟换装', 'AI换脸', '背景更换', '其他操作'],
                datasets: [{
                    data: [45, 25, 20, 10],
                    backgroundColor: [
                        '#ff6b9d',
                        '#4ecdc4',
                        '#45b7d1',
                        '#96ceb4'
                    ],
                    borderWidth: 0,
                    hoverOffset: 10
                }]
            },
            options: {
                responsive: true,
                maintainAspectRatio: false,
                plugins: {
                    legend: {
                        position: 'bottom',
                        labels: {
                            padding: 20,
                            usePointStyle: true
                        }
                    }
                }
            }
        });
    </script>
</body>
</html>
